package org.longsheng.tool;

import org.jasypt.util.text.BasicTextEncryptor;

public class Ulisesbocchio {
    public static void main(String[] args) {
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        // application.properties, jasypt.encryptor.password 加密盐值
        encryptor.setPassword("xyyVuAgZe8tjZRDr");
        // 加密数据库连接地址
        System.out.println(encryptor.encrypt(
                "jdbc:mysql://127.0.0.1:3306/mysql?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=UTC"));
        // 加密数据库连接用户名
        System.out.println(encryptor.encrypt("user"));
        // 加密数据库连接密码
        System.out.println(encryptor.encrypt("123456"));
        // 加密ip地址
        System.out.println(encryptor.encrypt("127.0.0.1"));

        System.out.println("============================解密===================================");
        System.out.println(encryptor.decrypt("uU0ZvlJE7x8MYrQE6Yj3aorMUX5WlPRlsWBL0vuOyfAYzLU2xT5us9oldX8OfWJn3G/a671I/dMLsbjE1pOWTma8lncxD0zEShgBMBBPy4xzwAiBons4ojWOL666Mj948xC0uERd4jchCPK0WbycU1wU827GsIuC80Z29kzcB/2i4VtHa1+1/ukFkU0cttmuojtIwoTyYyjrjltB+0w2Z3PKydUFywmJA4KSBf3CxQM="));
        System.out.println(encryptor.decrypt("6/TQQ2LXSk4a/B9WeQ9Xdw=="));
        System.out.println(encryptor.decrypt("xWw2uCn5jDQiIZ7UZqHlM8cxAMZITa3iYp45DsfNyuM="));
        System.out.println("-------------------------------------------------------------------");
        System.out.println(encryptor.decrypt("CVki/yXk7XIXngDrvmDntnQF6vQggO2J"));
        System.out.println(encryptor.decrypt("BqGtrfKl+546ORiuI/jeHb6I0EFMPlQhOH2dgy9iAuE="));
        System.out.println("-------------------------------------------------------------------");
        System.out.println(encryptor.decrypt("SdbbzE3EAF7KG8Y10YeUHkHZTGU2qV+v"));
        System.out.println(encryptor.decrypt("4pbdmvks8mi4cWgPd9PtoQ=="));
        System.out.println(encryptor.decrypt("dd9riDuYtgxaPYYw2HKETz6hYQfja+Gc3D6WEEN1iAA="));
    }
}
